#include <iostream>

using namespace std;

int main(void)
{
    //break使用时机

    //1、出现在switch语句中
    cout << "请选择副本难度" << endl;
    cout << "1、普通" << endl;
    cout << "2、中等" << endl;
    cout << "3、困难" << endl;

    int select = 0;//创建选择结果的变量

    cin >> select;//等待用户输入
    switch(select)
    {
        case 1:
            cout << "您选择的是普通难度" << endl;
            break;
        case 2:
            cout << "您选择的是中等难度" << endl;
            break;
        case 3:
            cout << "您选择的是困难难度" << endl;
            break;
        dafult:
            break;
    }
    
    //2、出现在循环语句中
    for (int i = 0; i < 10; i++)
    {
        cout << i << endl;
        if(i == 5)
        {
            break;
        }
    }

    //3、出现在嵌套循环语句中
    int num1 = 0, num2 = 0;
    while (num1 < 10)
    {
        while(num2 < 10)
        {
            cout << '*';
            num2++;
            if( num1 == 5)
            {
                break;
            }
        }
        cout << endl;
        num1++;
        num2 = 0;
        if(num1 == 7)
        {
            break;
        }
    }

    return 0;
}